<?php
C_base::Dy('c.kefu.kfbase');
class shenhe extends kfbase{
	
	var $_vpath='kefu/shenhe/';  //定义调用模板所属一级文件夹
	function __construct(){
		parent::__construct();
		$this->title='新闻管理';
	}
/**********************************企业注册******************************/
	function qy(){//企业审核列表
		$this->tit = '企业审核列表';
		$w = array('zt'=>'0');
		$this->rs = C_base::M('admin.recruit')->qy_ss($w);
	}
	
	function qyxx(){//企业审核详情页
		extract($this->_get());
		$this->title = '企业审核详情页';
		$w1 = array('id'=>$id);
		$a = C_base::M('admin.recruit')->qy_s($w1);
		$w2 = array('uid'=>$id);
		$b = C_base::M('admin.recruit')->qys_s($w2);
		$this->r = array('uid'=>$a['id'],'zt'=>$a['zt'],'dltime'=>$a['dltime'],'time'=>$a['time'],'lx'=>$a['lx'],
				'qy_name'=>$b['qy_name'],'logo'=>$b['logo'],'qyxz'=>$b['qyxz'],'address'=>$b['address'],
				'linkman'=>$b['linkman'],'phone'=>$b['phone'],'email'=>$b['email'],
				'yyzzh'=>$b['yyzzh'],'yimg'=>$b['yimg'],'qyjj'=>$b['qyjj'],'url'=>$b['url']);
		$rs = C_base::M('admin.recruit')->industry_s(array('id'=>$b['sshy']));
		$this->r['sshy'] = @$rs['name'] ? $rs['name'] : '';
		$this->r['sheng'] = $this->user_dz($b['sheng']);
		$this->r['shi'] = $this->user_dz($b['shi']);
		$this->r['qu'] = $this->user_dz($b['qu']);
	}
	
	function qy_xiu(){//企业状态修改
		extract($this->_post());
		$w = array('id'=>$id);
		$u = array('zt'=>$zt);
		if($zt == 4){
			if(empty($jjyy)){
				exit('-1');//填写拒绝原因
			}
			$u['jjyy'] = $jjyy;
		}
		$r = C_base::M('admin.recruit')->qy_u($w,$u);
		if($r == 1){
			exit('cg');
		}else{
			exit('error');
		}
	}
	
	function user_dz($id){//根据地址id获取地址名称
		$rs = C_base::M('admin.port')->linkage_s(array('area_id'=>$id));
		return @$rs['area_name'] ? $rs['area_name'] : '';
	}
/**********************************代理招聘******************************/
/**********************************课件******************************/
	function kj(){//课件审核列表
		$this->title = '课件审核列表';
		$w = array('zt!'=>1);
		for($i=0;$i<=9;$i++){
			$r = C_base::M('admin.recruit')->sp_ss($i,$w);
			if(@$r){
				$rs[] = $r;
			}
		}
		$this->rs = util::arr_one($rs);
	}
	
	function kjxx(){//审核详情页
		extract($this->_get());
		$this->title = '审核详情页';
		$w = array('id'=>$id);
		$this->r = C_base::M('admin.recruit')->sp_s($zjid,$w);
		$this->r['content'] = htmlspecialchars_decode($this->r['content']);
		if(@$this->r['shipin']){
			$aa = str_replace(DS,'/',$this->r['shipin']);
			$this->lj =$this->_url.$aa;
		}
	}
	
	function kj_xiu(){//修改状态
		extract($this->_post());
		$w = array('id'=>$id,'zjid'=>$zjid);
		
		$u = array('zt'=>$zt,'stime'=>time());
		if($zt == '2'){
			if(empty($jjyy)){
				exit('-1');//填写原因
			}
			$u['jjyy'] = $jjyy;
		}
		$r = C_base::M('admin.recruit')->sp_u($w,$u);
		if($r == 1){
			exit('cg');
		}else{
			exit('error');
		}
	}
}
/*********************************************************************文件已结束*****************************************************************/